﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SiteMapInfo.aspx.cs" Inherits="Manage_SiteMapInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>添加栏目</title>
    <link href="!css/content.css" rel="stylesheet" type="text/css" />
    <script src="!js/default.js" type="text/javascript"></script>
    <script src="!js/jquery-1.7.1.js" type="text/javascript"></script>
    <!--colorbox-->
    <link href="/!js/colorbox/colorbox.css" rel="stylesheet" type="text/css" />
    <script src="/!js/colorbox/jquery.colorbox-min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('.colorbox').colorbox({ iframe: true, width: 500, height: 400 });
        });
    </script>
    <!--colorbox-->
</head>
<body>
    <form id="form2" runat="server">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td class="bgleft" valign="top">
                <img src="/Backend/images/left-top-right.gif" />
            </td>
            <td class="bgcenter" valign="top">
                <div class="title">
                    栏目信息</div>
            </td>
            <td class="bgright" width="16" valign="top">
                <img src="/Backend/images/nav-right-bg.gif" />
            </td>
        </tr>
        <tr class="main">
            <td class="bgleft" valign="middle">
                &nbsp;
            </td>
            <td valign="top">
                <!--Content-->
                <div class="content">
                    <div class="list_title">
                        栏目信息显示 <a class="colorbox add_news" href="SiteMapAdd.aspx">添加最顶级父栏目</a>
                    </div>
                    <div>
                        <%foreach (Wsitech.Model.SiteMapInfo item in parentSiteMaps)
                          {
                        %>
                        <div style="width: 50%; float: left; border: 1px dotted grey; line-height: 25px;
                            padding: 5px; margin: 5px;">
                            <div class="parent">
                                <%=item.SitemapName%>
                                <a class="colorbox" href="SiteMapAdd.aspx?pid=<%=item.SitemapId%>">添加一级子菜单</a>|
                                <a class="colorbox" href="SiteMapAdd.aspx?sid=<%=item.SitemapId%>">修改</a>
                            </div>
                            <div class="list">
                                <%foreach (var sunItem in Wsitech.BLL.SiteMapInfoBLL.Instance.GetSiteMapByParentId(item.SitemapId))
                                  {
                                %>
                                <div style="margin-left: 20px;">
                                    <div class="parent">
                                        <%if (sunItem.FrontUrl != "")
                                          { 
                                        %>
                                        <img src="images/icon_front.png" alt="前台菜单" />
                                        <%
                                          } %>
                                        <%if (sunItem.BackUrl != "")
                                          { 
                                        %>
                                        <img src="images/icon_back.png" alt="后台菜单" />
                                        <%
                                          } %>
                                        <span>
                                            <%=sunItem.SitemapName %></span> <a class="colorbox" href="SiteMapAdd.aspx?pid=<%=sunItem.SitemapId%>">
                                                添加二级子菜单</a> | <a class="colorbox" href="SiteMapAdd.aspx?sid=<%=sunItem.SitemapId%>">
                                                    修改</a>
                                    </div>
                                    <div class="list">
                                        <%foreach (var grandSunItem in Wsitech.BLL.SiteMapInfoBLL.Instance.GetSiteMapByParentId(sunItem.SitemapId))
                                          {
                                        %>
                                        <div style="margin-left: 20px;">
                                            <%=grandSunItem.SitemapName %>
                                            <a class="colorbox" href="SiteMapAdd.aspx?sid=<%=grandSunItem.SitemapId %>">修改</a>
                                        </div>
                                        <%
                                          } %>
                                    </div>
                                </div>
                                <%
                                  }%>
                            </div>
                        </div>
                        <%
                          } %>
                    </div>
                    <script type="text/javascript">
                        $('.list').hide();
                        $('.parent').click(function () {
                            var list = $(this).next('.list');
                            if (list.is(':visible')) {
                                list.slideUp();
                            }
                            else {
                                list.slideDown();
                            }

                        });
                    </script>
                </div>
                <!--Content-->
            </td>
            <td class="bgright">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="bg_bottom_left" valign="bottom">
                &nbsp;
            </td>
            <td class="bg_bottom_center">
            </td>
            <td class="bg_bottom_right" valign="bottom">
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
